local vLastDizzyingHaze = 0.1
local lastStagger = 0
ccR.Monk.Brew_Master = {
	Stagger =
	function()
		for debuffIndex = 1, 40 do
			local name, _, icon, _, _, duration, expires, _, _, _, _, _, _, _, value1, _, _ = UnitAura("player", debuffIndex, "HARMFUL")
			if name and name:lower():find("stagger") then
				staggerAmount = (value1 or 0);
				staggerPercent = (100 * value1 / UnitHealth("player"));
			end
		end
		if staggerAmount and staggerAmount ~= 0 then lastStagger = staggerAmount return staggerAmount end
		if staggerAmount == 0 or not staggerAmount or not ccR.Target.Exists() then return 0 end
	end,
	Dizzying_Haze = 
	function(delay)
		delay = delay or 2
		if (GetTime()-vLastDizzyingHaze) > delay then
			for x = 1, # ccR_Enemies_Within_8 do
				local vUnit = ccR_Enemies_Within_8[x]
				if not ccR.Unit.Has.MyDebuff(vUnit, DIZZYING_HAZE_DEBUFF)
				and ccR.Player.Is.Facing(vUnit)
				and ccR.Spell.Is.Ready(DIZZYING_HAZE)
				then
					ccR.Cast.AoE(DIZZYING_HAZE, vUnit, 40, 8)
					vLastDizzyingHaze = GetTime()
				end
			end
			if SpellIsTargeting() then SpellStopTargeting() end
		end
	end,
	Breath_of_Fire = 
	function()
		for x = 1, # ccR_Enemies_Within_8 do
			local vUnit = ccR_Enemies_Within_8[x]
			if ccR.Unit.Has.MyDebuff(vUnit, DIZZYING_HAZE_DEBUFF)
			and ccR.Unit.Distance(vUnit, "player") <= 8
			and ccR.Player.Is.Facing(vUnit)
			and ccR.Player.Chi() >= 2
			and not ccR.Unit.Has.MyDebuff(vUnit, BREATH_OF_FIRE)
			then
				ccR.Cast.Spell(BREATH_OF_FIRE)
			end
		end
	end,
}
setmetatable(ccR.Monk.Brew_Master, ccR.Monk)